From 20d2cc96f8346d372e2caedd8207a1644152b883 Mon Sep 17 00:00:00 2001 From: "cl349@freefall.cl.cam.ac.uk" Date: Thu, 11 Nov 2004 17:29:53 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.412 (4193a1919CNLBKTNSj3aLn7Jd6TpGA) Synchronize domain time updates between CPUs. --- xen/arch/x86/time.c | 4 ++++ xen/common/domain.c | 2 ++ xen/include/xen/sched.h | 7 ++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 7ee85cc22a..cc9ef381b9 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -281,6 +281,8 @@ void update_dom_time(struct domain *d) read_lock_irqsave(&time_lock, flags); + spin_lock(&d->time_lock); + si->time_version1++; wmb(); @@ -293,6 +295,8 @@ void update_dom_time(struct domain *d) wmb(); si->time_version2++; + spin_unlock(&d->time_lock); + read_unlock_irqrestore(&time_lock, flags); } diff --git a/xen/common/domain.c b/xen/common/domain.c index d35d19d43c..ba54ae4d69 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -44,6 +44,8 @@ struct domain *do_createdomain(domid_t dom_id, unsigned int cpu) memcpy(&ed->thread, &idle0_exec_domain.thread, sizeof(ed->thread)); + spin_lock_init(&d->time_lock); + spin_lock_init(&d->page_alloc_lock); INIT_LIST_HEAD(&d->page_list); INIT_LIST_HEAD(&d->xenpage_list); diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 01479cc031..d33806b326 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -109,10 +109,11 @@ struct exec_domain }; struct domain { - domid_t id; - s_time_t create_time; + domid_t id; + s_time_t create_time; - shared_info_t *shared_info; /* shared data area */ + shared_info_t *shared_info; /* shared data area */ + spinlock_t time_lock; spinlock_t page_alloc_lock; /* protects all the following fields */ struct list_head page_list; /* linked list, of size tot_pages */ -- 2.30.2